<?php
namespace app\process;

use Workerman\Crontab\Crontab;
use app\services\ExampleService;
use Illuminate\Support\Facades\Log;

class CrontabFiveProcess
{
    public function onWorkerStart()
    {
        // 每5分钟执行一次
        new Crontab('0 5 * * * *', function(){
            try{
                ExampleService::five() ;
            }catch(\Exception $e){
                Log::error(__METHOD__, []) ;
            }
        });
    }
}